package com.ruoyi.scheduleTask

import org.quartz.*
import java.util.*

const val NAME = "system_notice"
const val GROUP = "system_notice_group"

fun Class<out Job>.jobDetail(name: String): JobDetail = JobBuilder.newJob(this).withIdentity(name, GROUP).build()
fun Date.trigger(name: String): SimpleTrigger = TriggerBuilder.newTrigger()
    .withIdentity(name, GROUP)
    .startAt(this)
    .withSchedule(
        SimpleScheduleBuilder.simpleSchedule()
            .withIntervalInSeconds(0)
            .withRepeatCount(0)
    )
    .build()